;buildInfoPackage: chisel3, version: 3.3-SNAPSHOT, scalaVersion: 2.12.10, sbtVersion: 1.3.2
circuit DecoupledGcd : 
  module DecoupledGcd : 
    input clock : Clock
    input reset : UInt<1>
    input input : {flip ready : UInt<1>, valid : UInt<1>, bits : {value1 : UInt<16>, value2 : UInt<16>}}
    output output : {flip ready : UInt<1>, valid : UInt<1>, bits : {value1 : UInt<16>, value2 : UInt<16>, gcd : UInt<16>}}
    
    reg xInitial : UInt, clock @[DecoupledGCD.scala 30:24]
    reg yInitial : UInt, clock @[DecoupledGCD.scala 31:24]
    reg x : UInt, clock @[DecoupledGCD.scala 32:24]
    reg y : UInt, clock @[DecoupledGCD.scala 33:24]
    reg busy : UInt<1>, clock with : (reset => (reset, UInt<1>("h00"))) @[DecoupledGCD.scala 34:28]
    reg resultValid : UInt<1>, clock with : (reset => (reset, UInt<1>("h00"))) @[DecoupledGCD.scala 35:28]
    node _T = eq(busy, UInt<1>("h00")) @[DecoupledGCD.scala 37:18]
    input.ready <= _T @[DecoupledGCD.scala 37:15]
    output.valid <= resultValid @[DecoupledGCD.scala 38:16]
    output.bits.gcd is invalid @[DecoupledGCD.scala 39:15]
    output.bits.value2 is invalid @[DecoupledGCD.scala 39:15]
    output.bits.value1 is invalid @[DecoupledGCD.scala 39:15]
    when busy : @[DecoupledGCD.scala 41:15]
      node _T_1 = gt(x, y) @[DecoupledGCD.scala 42:12]
      when _T_1 : @[DecoupledGCD.scala 42:17]
        node _T_2 = sub(x, y) @[DecoupledGCD.scala 43:14]
        node _T_3 = tail(_T_2, 1) @[DecoupledGCD.scala 43:14]
        x <= _T_3 @[DecoupledGCD.scala 43:9]
        skip @[DecoupledGCD.scala 42:17]
      else : @[DecoupledGCD.scala 44:17]
        node _T_4 = sub(y, x) @[DecoupledGCD.scala 45:14]
        node _T_5 = tail(_T_4, 1) @[DecoupledGCD.scala 45:14]
        y <= _T_5 @[DecoupledGCD.scala 45:9]
        skip @[DecoupledGCD.scala 44:17]
      node _T_6 = eq(x, UInt<1>("h00")) @[DecoupledGCD.scala 47:12]
      node _T_7 = eq(y, UInt<1>("h00")) @[DecoupledGCD.scala 47:25]
      node _T_8 = or(_T_6, _T_7) @[DecoupledGCD.scala 47:20]
      when _T_8 : @[DecoupledGCD.scala 47:34]
        node _T_9 = eq(x, UInt<1>("h00")) @[DecoupledGCD.scala 48:14]
        when _T_9 : @[DecoupledGCD.scala 48:23]
          output.bits.gcd <= y @[DecoupledGCD.scala 49:25]
          skip @[DecoupledGCD.scala 48:23]
        else : @[DecoupledGCD.scala 50:19]
          output.bits.gcd <= x @[DecoupledGCD.scala 51:25]
          skip @[DecoupledGCD.scala 50:19]
        output.bits.value1 <= xInitial @[DecoupledGCD.scala 54:26]
        output.bits.value2 <= yInitial @[DecoupledGCD.scala 55:26]
        resultValid <= UInt<1>("h01") @[DecoupledGCD.scala 56:19]
        node _T_10 = and(output.ready, resultValid) @[DecoupledGCD.scala 58:25]
        when _T_10 : @[DecoupledGCD.scala 58:41]
          busy <= UInt<1>("h00") @[DecoupledGCD.scala 59:14]
          resultValid <= UInt<1>("h00") @[DecoupledGCD.scala 60:21]
          skip @[DecoupledGCD.scala 58:41]
        skip @[DecoupledGCD.scala 47:34]
      skip @[DecoupledGCD.scala 41:15]
    else : @[DecoupledGCD.scala 63:15]
      when input.valid : @[DecoupledGCD.scala 64:23]
        input.ready <= UInt<1>("h01") @[Decoupled.scala 65:20]
        x <= input.bits.value1 @[DecoupledGCD.scala 66:9]
        y <= input.bits.value2 @[DecoupledGCD.scala 67:9]
        xInitial <= input.bits.value1 @[DecoupledGCD.scala 68:16]
        yInitial <= input.bits.value2 @[DecoupledGCD.scala 69:16]
        busy <= UInt<1>("h01") @[DecoupledGCD.scala 70:12]
        skip @[DecoupledGCD.scala 64:23]
      skip @[DecoupledGCD.scala 63:15]
    
